import request from "@/utils/request";
//分页查询
export function listDiscount(query) {
  return request({
    url: "/pricingRule/page",
    method: "get",
    params: query
  });
}
//不分页查询所有
export function listAllDiscount() {
  return request({
    url: "/pricingRule/list",
    method: "get"
  });
}
//添加折扣
export function addDiscount(data) {
  return request({
    url: "/pricingRule",
    method: "post",
    data: data
  });
}

//删除折扣
export function deleteDiscount(pricingRuleId) {
  return request({
    url: "/pricingRule/delete/" + pricingRuleId,
    method: "delete"
  });
}
//查询折扣
export function searchDiscount(pricingRuleId) {
  return request({
    url: "/pricingRule/" + pricingRuleId,
    method: "get"
  });
}

//修改折扣
export function editDiscount(data) {
  return request({
    url: "/pricingRule",
    method: "put",
    data: data
  });
}
